#include <bits/stdc++.h>

using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    vector<pair<int, int>> edges(M);
    for (auto&& [u, v] : edges) {
        cin >> u >> v;
        --u;
        --v;
    }

    int ans = M;
    for (int bit = 0; bit < 1 << N; ++bit) {
        int del = 0;
        for (const auto& [u, v] : edges) {
            if ((1 & (bit >> u)) == (1 & (bit >> v)))
                ++del;
        }
        ans = min(ans, del);
    }
    cout << ans << endl;
    return 0;
}
